/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-03-08     Lenovo       the first version
 */
#ifndef __LOCK_H__
#define __LOCK_H_
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <send_all_control.h>
#include <string.h>
#include <aht10.h>
#include <as608.h>
#include <rtdbg.h>
#include <rtdef.h>

#define KEY_UP_NUM          GET_PIN(C,  5)
#define KEY_DOWN_NUM        GET_PIN(C,  1)
#define KEY_LEFT_NUM          GET_PIN(C,  0)
#define KEY_RIGHT_NUM        GET_PIN(C,  4)
#define AS60X_UART_NAME "uart2"
#define AS60X_WAK_PIN        GET_PIN(G, 4)
#define EVENT_KEY_UP        (1 << 0)
#define EVENT_KEY_DOWN      (1 << 1)
#define EVENT_KEY_RIGHT     (1 << 2)
#define EVENT_FP_TOUCH       (1 << 3)

extern rt_uint16_t page_id;
extern rt_uint16_t mat_score;
extern rt_timer_t unlock_timer;
extern struct rt_event *fp_event_ptr;
//as60x_ack_type_t yanzheng;

void key_up_handler(void *args);
void key_down_handler(void *args);
void key_right_handler(void *args);
void fp_touch_handler(void *args);
void ALL_Init();
void UP_FINGER_STR();
void timer_callback(void *parameter);
rt_err_t verify_fingerprint(void);
void jiesuo();
rt_err_t delete_fingerprint();
void lock();
void mensuo_thread_entry(void *parameter);

extern volatile rt_bool_t is_verifying; // 新增验证状态标志
#endif /* __LOCK_H__ */


